import http from "@/utils/http";
import { AxiosRequestConfig } from "axios";

export interface GetFindOne_ {
  /**
   * @description 页面标识
   * @example MODIFIER
   */
  pageCode: string;
}

export class UserPageSetting {
  /**
   * 查询配置信息
   *
   * @tags 用户页面配置信息
   * @request GET: /userPageSetting/findOne
   * @secure
   */
  getFindOne = (query: { pageCode: string } | GetFindOne_, params: AxiosRequestConfig = {}) =>
    http.request<defs.ResponseEntity>({
      url: `/userPageSetting/findOne`,
      method: "GET",
      params: query,
      ...params,
    });

  /**
   * 保存配置信息
   *
   * @tags 用户页面配置信息
   * @request POST: /userPageSetting/save
   * @secure
   */
  postSave = (vo: defs.UserPageSettingVO, params: AxiosRequestConfig = {}) =>
    http.request<defs.ResponseEntity>({
      url: `/userPageSetting/save`,
      method: "POST",
      data: vo,
      ...params,
    });
}

export default new UserPageSetting();
